// web/src/app/api/(forum)/likes/[postId]/route.ts
import {NextRequest, NextResponse} from "next/server";
import {db} from "@/lib/db";

export async function GET(req: NextRequest) {
    let url = req.url
    let commentId = (url.slice(
        url.lastIndexOf('/') + 1
    ))

    const likes = await db.like.findMany({
        where: {commentId}
    })

    return NextResponse.json({likes})
}